package com.cong.project.controller;

import com.cong.project.common.BaseResponse;
import com.cong.project.common.ResultUtils;
import com.cong.project.model.vo.ClassifyVo;
import com.cong.project.service.ClassifyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 控制器进行分类
 *
 * @author 86188
 * @date 2023/02/09
 */
@RequestMapping("classify")
@RestController
public class ClassifyController {
    @Resource
    private ClassifyService classifyService;
    /**
     * 获取商品分类
     * @return
     */
    @GetMapping("/classify")
    public BaseResponse getClassifyList(){

        List<ClassifyVo> classifyVoList=  classifyService.getClassifyList();

        return ResultUtils.success(classifyVoList);
    }
}
